package com.gltc.framework;

import javax.sql.DataSource;

import org.mybatis.spring.SqlSessionFactoryBean;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
@MapperScan(basePackages ="com.gltc.oracle.dao",sqlSessionFactoryRef="oracleSessionFactory")
public class OracleSqlSessionConfig {

	@Autowired
	@Qualifier("oracletc")
	private DataSource oracletc;

	@Bean(name = "oracleSessionFactory")
	public SqlSessionFactoryBean getOracleSessionFactory() throws Exception {
		SqlSessionFactoryBean sessionFactory = new SqlSessionFactoryBean();
		sessionFactory.setDataSource(oracletc);
		return sessionFactory;
	}
	
}
